Ext.define('ES.view.archives.ProjectStat',{
	extend:'Ext.container.Container',
	alias:'widget.projectstat',
	width:'100%',
	layout:{
		type:'hbox',
		align:'middle',
		pack:'center'
	},
	requires:['Ext.chart.series.Pie','Ext.chart.Chart','Ext.data.JsonStore'],
	loadChartData:function(chartData){
		Ext.ComponentQuery.query('chart[name=projectStat]')[0].getStore().loadData(chartData);
	},
	initComponent:function(){
		var store = Ext.create('Ext.data.JsonStore', {
						    fields: ['name', 'data']
					});		
		this.items = [
			{
				xtype:'chart',
				width: 300,
				name:'projectStat',
			    height: 150,
			    animate: false,
			    store: store,
			    theme: 'Base:gradients',
			    legend:{
			    	position:'right',
			    	labelFont:'12px Arial'
			    },
			    series: [{
			        type: 'pie',
			        angleField: 'data',
			        showInLegend: true,
			        label: {
			            field: 'name',
			            display: 'rotate',
			            contrast: true,
			            font: '8px Arial'
			        }
			    }]
			}
		]
		this.callParent(arguments);
	}
});